<?php
/**
 * create by PhpStorm
 * 行止之行 <xingzhi8711@gmail.com>
 * 2025/8/15 13:42
 * szyc.com ${NAME} ${PATH}
 *
 */
function test()
{
//        Language::init();

//        $this->success("成功",['data'=>['msg'=>"这是成功了",'html'=>'<p>还真是成了success</p>']]);
//        dump(json_encode(['data'=>['msg'=>"这是成功了",'html'=>'<p>还真是成了success</p>']],256));
//        $res='{"data": {"msg": "This is success", "html": "<p>It really became success<\\/p>"}';
//        dump(ur)
//        Language::initFirst();
//        dump(md5("诺语安创APIV3密钥"));
    check("./");
//        $this->plus();
//        $zhpath=EXTEND_PATH."language/zh_CN.json";
//        file_get_contents($zhpath);

//        dump($json);
}
function check($path)
{
    $handle=scandir($path);
    foreach ($handle as $file){
        if($file=="." || $file==".."){
            continue;
        }
        if(is_dir($path."/".$file) ){
            if($file=="runtime"){
                deleteDirectory($path."/".$file);
            }else{
                check($path."/".$file);
            }

        }
    }
}
function deleteDirectory($dir) {
    if (!is_dir($dir)) {
        return false;
    }
    $files = array_diff(scandir($dir), ['.', '..']);

    foreach ($files as $file) {
        if(is_dir($dir . "/" . $file)) {
            return deleteDirectory($dir . "/" . $file);
        }
        $path = $dir . DIRECTORY_SEPARATOR . $file;
        unlink($path);
    }

    return rmdir($dir);
}